import TestWorker from './worker/testWorker.js?worker'
console.log('主线程开始执行')
const worker = new TestWorker()
worker.onmessage = (msg) => {
  // 终止worker线程
  worker.terminate()
  console.log('work msg', msg)
}
worker.onerror = (err) => {
  console.log('work err', err)
}
worker.postMessage(1)
console.log('主线程结束执行')

